#include "LinkedList.h"
#include "Shape.h"
#include <iostream>
#include "StopWatch.h"
#include "d_random.h"
#include <math.h>

void main()
{
	int SMALL = 10;
	int LARGE = 50000;

	double n2ORel = pow((double)(LARGE/SMALL), 2);
	double nlognORel = ((double)LARGE/(double)SMALL) * log(((double)LARGE/(double)SMALL));
	double n2SmallTime, n2LargeTime, nlognSmallTime, nlognLargeTime;

	StopWatch watch;
	randomNumber rand;

    LinkedList<int> smallList1;
	LinkedList<int> smallList2;
	LinkedList<int> largeList1;
	LinkedList<int> largeList2;
    for(int i=0; i<SMALL; i++)
	{
		smallList1.PushBack(i);
		smallList2.PushBack((int)rand.random());
	}
	for(int i=0; i<LARGE; i++)
	{
		largeList1.PushBack((int)rand.random());
		largeList2.PushBack((int)rand.random());
	}

	cout << "Length: " << smallList1.Length() << endl;
	while(smallList1.Length() > 0)
		cout << smallList1.PopBack() << " ("<<smallList1.Length()<<")"<< endl;

	/*watch.start();
	smallList1.QuickSort();
	nlognSmallTime = watch.stop();
	cout << "Small List (" << SMALL << " elements) QuickSort: " << nlognSmallTime << endl;
	watch.start();
	largeList1.QuickSort();
	nlognLargeTime = watch.stop();
	cout << "Large List (" << LARGE << " elements) QuickSort: " << nlognLargeTime << endl;
	cout << "Quick Sort relation: " << (nlognLargeTime / nlognSmallTime) << endl;
	cout << "O(n*log(n)) relation: " << nlognORel << endl << endl;*/
	/*watch.start();
	smallList2.SelectionSort();
	n2SmallTime = watch.stop();
	cout << "Small List SelectionSort: " << n2SmallTime << endl;
	watch.start();
	largeList2.SelectionSort();
	n2LargeTime = watch.stop();
	cout << "Large List SelectionSort: " << n2LargeTime << endl;
	cout << "Selection Sort relation: " << (n2LargeTime / n2SmallTime) << endl;
	cout << "O(n^2) relation: " << n2ORel << endl << endl;*/

    system("PAUSE");
}